home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / mutt / me2s_pl7.zoo / mu_edit2 / ed / ed.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-05  |  2.9 KB  |  76 lines

  1. /* $Id: ed.h,v 1.1 1992/09/14 13:02:14 mike Exp $ */
  2.  
  3. /* $Log: ed.h,v $
  4.  * Revision 1.1  1992/09/14  13:02:14  mike
  5.  * Initial revision
  6.  *
  7.  */
  8.  
  9. /* ed.h : stuff for Editors 
  10.  */
  11.  
  12. /* Craig Durland    Public Domain
  13.  *   Distributed "as is", without warranties of any kind, but comments,
  14.  *     suggestions and bug reports are welcome.
  15.  */
  16.  
  17. #ifndef _ED_H_INCLUDED        /* so this won't be included twice */
  18. #define _ED_H_INCLUDED
  19.  
  20. /* ******************************************************************** */
  21. /* ***************** KEYS ********************************************* */
  22. /* ******************************************************************** */
  23.  
  24. #define CTRL    0x0100        /* Control flag, or'ed in */
  25. #define META    0x0200        /* Meta prefix key aka PFIX 0 */
  26. #define SHIFT    0x1000        /* a shifted sofkey */
  27. #define PFIX1   0x0400        /* a prefix key */
  28. #define PFIX2    0x2000        /* a prefix key */
  29. #define PFIX3    0x4000        /* a prefix key */
  30. #define SOFKEY  0x0800        /* soft key flag, or'ed in */
  31. #define BUTTON  0x8000        /* mouse button or some such */
  32.  
  33.     /* A KeyCode is 16 bits:  8 for flags, 8 for the character */
  34. typedef unsigned short int KeyCode;
  35.  
  36.   /* The pkeys array is: { META prefix, PFIX1, PFIX2, PFIX3 }
  37.    * If there is no META prefix (ie a the keyboard has a real meta key),
  38.    *   set the META prefix to SHIFT.
  39.    * To turn off a a prefix key, set it to SHIFT.
  40.    */
  41.  
  42. #define PKEYS 4            /* number of prefix keys */
  43. typedef KeyCode PKey;        /* what a prefix key is */
  44.  
  45. #define declare_pkeys(name,pfix0,pfix1,pfix2,pfix3)    \
  46.   PKey name[PKEYS] = { pfix0,pfix1,pfix2,pfix3 }
  47.  
  48. /* ******************************************************************** */
  49. /* ***************** Key Tables *************************************** */
  50. /* ******************************************************************** */
  51.  
  52. #define clear_keytable(kt) reset_dTable(kt);
  53.  
  54. /* ******************************************************************** */
  55. /* ***************** TABS ********************************************* */
  56. /* ******************************************************************** */
  57.  
  58.     /* col is 0 relative */
  59. #define BLANKS_IN_TAB 8
  60. #define NEXT_TAB_STOP(col)        (((col)+BLANKS_IN_TAB)/BLANKS_IN_TAB)
  61. #define PREVIOUS_TAB_STOP(col)        ((col)/BLANKS_IN_TAB)
  62. #define TSTOC(tabstop)            ((tabstop)*BLANKS_IN_TAB)
  63. #define NEXT_TAB_COLUMN_MINUS_1(col)    ((col) | 7)
  64. #define NEXT_TAB_COLUMN(col)        (NEXT_TAB_COLUMN_MINUS_1(col) +1)
  65.  
  66. /* ******************************************************************** */
  67. /* *********** Routines in the ED lib ********************************* */
  68. /* ******************************************************************** */
  69.  
  70. extern char *Efind_key(), *Ekalloc();
  71. extern int Eset_pkey();
  72. extern KeyCode Ectok(), Eget_key(), Eto_keycode();
  73. extern void Expand_key(), Eclear_keytable(), Epack_keytable(), Eunbind_key();
  74.  
  75. #endif    /* _ED_H_INCLUDED */
  76.